# -*- coding: utf-8 -*-

import numpy as np
import cv2 as cv
import logging
from matplotlib import pyplot as plt

IMG_INPUT_FILE = "../../../imgs/pc_cocal.jpg"
IMG_OUTPUT_DIR = "../../../imgs/output"

logging.basicConfig(level=logging.INFO)

img = cv.imread(IMG_INPUT_FILE, cv.IMREAD_GRAYSCALE)
img_s = cv.resize(img, None, fx=0.25, fy=0.25, interpolation=cv.INTER_CUBIC)
logging.info("img shape: " + str(img.shape))
rows, cols = img.shape
M = np.float32([[1, 0, 400],
              [0, 1, 250]])

dst = cv.warpAffine(img, M, (cols, rows))

cv.imshow("img", dst)
k = cv.waitKey(10000)
cv.destroyAllWindows()
logging.info("k: " + str(k))
# print(img_s)
# fig, ax = plt.subplots(2, 2)
# logging.info("ax: " + str(ax))
#
# ax[0][0].imshow(img, cmap=plt.cm.gray)
# ax[0][1].imshow(img_s, cmap=plt.cm.gray)
# ax[1][0].imshow(dst, cmap='gray')
# plt.show()
